package com.louis.iread.bean;

import com.louis.iread.utils.DbUtil;

import org.xutils.DbManager;
import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;
import org.xutils.ex.DbException;

/**
 * Created by louis on 17-4-5.
 */

@Table(name = "article_content")
public class ArticleContent {

    @Column(name = "id", isId = true)
    private Long id;

    @Column(name = "articleId", property = "UNIQUE")
    private Long articleId;

    public Long getBookId() {
        return bookId;
    }

    public void setBookId(Long bookId) {
        this.bookId = bookId;
    }

    @Column(name = "bookId")
    private Long bookId;

    @Column(name = "content")
    private String content;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getArticleId() {
        return articleId;
    }

    public void setArticleId(Long articleId) {
        this.articleId = articleId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Article getArticle() throws DbException {
        return DbUtil.getDbManager().findById(Article.class, articleId);
    }
}
